Skip to content

Replace shlex with oslex within grep tool for Windows compatibility#53

Merged
dwash96 merged 4 commits intocecli-dev:coroutine-experimentfrom
jamwil:issue-52
Oct 25, 2025
Merged

Replace shlex with oslex within grep tool for Windows compatibility#53
dwash96 merged 4 commits intocecli-dev:coroutine-experimentfrom
jamwil:issue-52

Conversation

@jamwil
Copy link
Copy Markdown

@jamwil jamwil commented Oct 22, 2025

Per the Python shlex documentation:

Warning The shlex module is only designed for Unix shells.
The quote() function is not guaranteed to be correct on non-POSIX compliant shells or shells from other operating systems such as Windows. Executing commands quoted by this module on such shells can open up the possibility of a command injection vulnerability.
Consider using functions that pass command arguments with lists such as subprocess.run() with shell=False.

There is a Windows equivalent called mslex if we're ok adding another external dependency. Please advise and I will update.

We already use oslex which wraps shlex and mslex, so I've simply swapped that out.

Closes #52 once merged.

@jamwil jamwil marked this pull request as ready for review October 23, 2025 15:20
@jamwil jamwil changed the title Remove shlex from grep tool for Windows compatibility Replace shlex with oslex within grep tool for Windows compatibility Oct 23, 2025
@dwash96 dwash96 changed the base branch from main to coroutine-experiment October 25, 2025 20:26
@dwash96 dwash96 merged commit ce5dde7 into cecli-dev:coroutine-experiment Oct 25, 2025
8 checks passed
@jamwil jamwil deleted the issue-52 branch December 9, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

grep tool failing on Windows directory paths

2 participants